<script>
export default {
  name: "tableColumn",
  props: {
    data: {
      require: true,
      type: Object,
    },
  },
  render: function (createElement) {
    return createElement("el-table-column", {
      props: {
        ...this.data,
        "show-overflow-tooltip": true,
        renderHeader: (createElement, { column }) => {
          if (this.data.renderHeader) {
            return this.data.renderHeader(createElement, { column });
          } else {
            return column.label;
          }
        },
        formatter: (row, column, cellVal, index) => {
          if (this.data.render) {
            return this.data.render(createElement, row, column, index);
          } else {
            return cellVal;
          }
        },
      },
    });
  },
  methods: {},
};
</script>
